package com.qingke.easyjava.hibernate.bean;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Table(name="apartment")
@Entity
public class Apartment {
	@Id
	@Column(name="id")
	private int id;
	
	@Column(name="building")
	private String building;
	
	@Column(name="floor")
	private String floor;
	
	@Column(name="room")
	private String room;
	
	@Column(name="bed")
	private String bed;
	
	@OneToMany
	@JoinColumn(name="apartment_id")
	private Set<Accommodation> accommodations;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getBuilding() {
		return building;
	}
	public void setBuilding(String building) {
		this.building = building;
	}
	public String getFloor() {
		return floor;
	}
	public void setFloor(String floor) {
		this.floor = floor;
	}
	public String getRoom() {
		return room;
	}
	public void setRoom(String room) {
		this.room = room;
	}
	public String getBed() {
		return bed;
	}
	public void setBed(String bed) {
		this.bed = bed;
	}
	
	
	public Set<Accommodation> getAccommodations() {
		return accommodations;
	}
	public void setAccommodations(Set<Accommodation> accommodations) {
		this.accommodations = accommodations;
	}
	@Override
	public String toString() {
		return "[id=" + id + ", building=" + building + ", floor=" + floor + ", room=" + room + ", bed=" + bed
				+ "]";
	}
	
	
}
